package com.ok.prize.controller;


import com.ok.common.domain.po.Result;
import com.ok.prize.domain.po.OkUserprize;
import com.ok.prize.service.IOkUserprizeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 用户奖品关系表 前端控制器
 * </p>
 *
 * @author lhw
 * @since 2024-05-06
 */
@Api(tags = "用户奖品相关接口")
@RestController
@RequestMapping("/userprize")
@RequiredArgsConstructor
public class OkUserprizeController {

    private final IOkUserprizeService okUserprizeService;

    @ApiOperation("*兑换奖品")
    @PostMapping("/exchange")
    public Result exchange(@RequestParam Integer prizeId){
        okUserprizeService.exchange(prizeId);
        return Result.success("已成功兑换该奖品");
    }

}
